﻿CREATE TABLE [dbo].[sys_UserMessage]
(
	[MessageID] INT NOT NULL PRIMARY KEY IDENTITY, 
    [MessageContent] NVARCHAR(500) NOT NULL, 
    [CreatorUserID] INT NOT NULL , 
    [CreateDt] DATETIME NOT NULL default(getdate()), 
    [IsDeleted] BIT NOT NULL DEFAULT 0, 
    CONSTRAINT [FK_sys_UserMessage_User] FOREIGN KEY ([CreatorUserID]) REFERENCES [sys_LoginUsers]([UserID])
)

GO
EXEC sp_addextendedproperty @name = N'MS_Description',
    @value = N'消息内容',
    @level0type = N'SCHEMA',
    @level0name = N'dbo',
    @level1type = N'TABLE',
    @level1name = N'sys_UserMessage',
    @level2type = N'COLUMN',
    @level2name = N'MessageContent'
GO

CREATE INDEX [IX_sys_UserMessage_MessageContent] ON [dbo].[sys_UserMessage] ([MessageContent])

GO

CREATE INDEX [IX_sys_UserMessage_CreateDt] ON [dbo].[sys_UserMessage] ([CreateDt] DESC)
